<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


	/**
     * 日期数字转中文
     * 用于日和月、周
     * @static
     * @access public
     * @param integer $number 日期数字
     * @return string
     */
    if (!function_exists('numberToCh')) {
	    function  numberToCh($number) {
	        $number = intval($number);
	        $array  = array('一','二','三','四','五','六','七','八','九','十');
	        $str = '';
	        if($number  ==0)  { $str .= "十" ;}
	        if($number  <  10){
	           $str .= $array[$number-1] ;
	        }
	        elseif($number  <  20  ){
	           $str .= "十".$array[$number-11];
	        }
	        elseif($number  <  30  ){
	           $str .= "二十".$array[$number-21];
	        }
	        else{
	           $str .= "三十".$array[$number-31];
	        }
	        return $str;
	    }
    }


/* End of file common_helper.php */
/* Location: ./application/helpers/common_helper.php */